<?php
/* @var $this GatewayController */
/* @var $model Gateway */
Yii::app()->clientScript->registerCoreScript('jquery');
$this->breadcrumbs=array(
	'Gateways'=>array('index'),
	$model->id,
);

if(Yii::app()->user->name=="admin"){
	    $this->menu=array(
	    	array('label'=>'路由器信息', 'url'=>array('admin')),
			array('label'=>'创建路由器', 'url'=>array('create')),
            array('label'=>'路由器地图', 'url'=>array('gatewayMap')),
	    );
	   $buttoncolumn ='{view}{update}{delete}';
    }else{
	     $this->menu=array(
			array('label'=>'路由器信息', 'url'=>array('admin')),
	     ); 
	    $buttoncolumn ='{view}';
    } 
  
?>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=69ded0fbe1c5b68f1ddc628eb58dfbe2"></script>
<script type="text/javascript">
    $(document).ready(function(e) {
        var map = new BMap.Map("allmap");
        var myCity = new BMap.LocalCity();
        var point = new BMap.Point(<?php echo $model->lng?>, <?php echo $model->lat?>);
        map.centerAndZoom(point, 16);
        var marker = new BMap.Marker(point); 
        map.addOverlay(marker); 
             
    }); 
</script>
<h1>显示</h1>
<div class="Action">
    <a href="<?php echo Yii::app()->request->urlReferrer; ?>"><img src="<?php echo Yii::app()->request->baseUrl; ?>/images/admin/jiantou.png" style=""></a>
</div>

<?php $this->widget('zii.widgets.CDetailView', array(
    'data'=>$model,
    'itemCssClass'=>array('oddtablscss', 'eventablecss'),
	'attributes'=>array(
		//'id',
		'company.title',
		'gatewayname',
        'lasttime',
        'publicip',
        'privateip',
         array(  
            'label' => '所属省市',  
            'value' => $model->provinces.','.$model->citys, //CDataColumn $this->grid   
        ),
		'address',
        array(
            'name' => 'len_lat',
            'value' => $model->lng.','.$model->lat,
         ),
	),
)); ?>
<div id="allmap"></div>
